package com.hnchances.wjb.common;

import lombok.Data;

import java.io.Serializable;
@Data
public class R<T> implements Serializable {

    private Integer code;  //code说明：200：成功 400:业务异常 500:接口异常
    private String msg;
    private T result;

    public static <T> R<T> success(T Object){
          R r = new R();
          r.result = Object;
          r.code = 200;
        return r;
    }

    public static <T> R<T> error(String msg,Integer code){
        R r = new R();
        r.msg = msg;
        r.code = code;
        return r;
    }
}
